package org.jrfe.math;

public class Vector2f {
	public float x;
	public float y;
	
	public Vector2f() {
		this(0, 0);
	}

	public Vector2f(float x, float y) {
		this.x = x;
		this.y = y;
	}

	public void set(float x,float y){
		this.x = x;
		this.y = y;
	}
	
	public void copy(Vector2f v){
		v.set(this);
	}
	
	public void set(Vector2f v){
		this.x = v.x;
		this.y = v.y;
	}
	
	public void add(Vector2f v){
		this.x += v.x;
		this.y += v.y;
	}
	
	public void add(float x,float y){
		this.x += x;
		this.y += y;
	}
	
	public void substract(Vector2f v){
		this.x -= v.x;
		this.y -= v.y;
	}
	
	public void substract(float x,float y){
		this.x -= x;
		this.y -= y;
	}
	
	public void multiply(Vector2f v){
		this.x *= v.x;
		this.y *= v.y;
	}
	
	public void multiply(float x,float y){
		this.x *= x;
		this.y *= y;
	}
	
	public void divide(Vector2f v){
		this.x /= v.x;
		this.y /= v.y;
	}
	
	public void divide(float x,float y){
		this.x /= x;
		this.y /= y;
	}
	
	
	
	@Override
	public Vector2f clone() {
		return new Vector2f(x,y);
	}
	
	public float getX() {
		return x;
	}

	public void setX(float x) {
		this.x = x;
	}

	public float getY() {
		return y;
	}

	public void setY(float y) {
		this.y = y;
	}
}
